package com.shop.www.dao.Impl;

import com.shop.www.dao.OrderItemDAO;
import com.shop.www.model.OrderItem;
import com.shop.www.ssm.BasicDao;

import java.util.List;

public class OrderItemImpl extends BasicDao implements OrderItemDAO {
    @Override
    public void addorderItem(OrderItem orderItem) {
        String sql = ("insert into `orderItem` values(0,?,?,?)");
        update(sql,orderItem.getBuycount(),orderItem.getCommodity_ID(),orderItem.getOrder_ID());
    }

    @Override
    public List getorderItem(Integer order_Id) {
        String sql = ("select * from orderItem where order_ID = ?");
        List<OrderItem> orderItemList = querymany(sql,OrderItem.class,order_Id);
        return orderItemList;
    }

}
